package thread;


// 1.实现Runnable接口类，不是线程类
public class MyRunner implements Runnable{
	
	// 2.实现run方法
	@Override
	public void run() {
		for (int i = 0; i < 10; i++) {
			System.out.println("mythread:" + i);
		}
	}
	
	public static void main(String[] args) {
		// 3.创建对象
		MyRunner r = new MyRunner();
		// 4.创建线程类对象 
		Thread t = new Thread(r);
		// 5.启动线程
		t.start();
		
		for (int i = 0; i < 10; i++) {
			System.out.println("main:" + i);
		}
	}

}
